﻿using MediatR;
using RBAC.LuFang.API.Application.Command.slaughterCommand;
using RBAC.LuFang.Domain.Traceability;
using RBAC.LuFang.Domin.Services.TraceabilityService;

namespace RBAC.LuFang.API.Application.CommandHandlers.slaughterCommandHandler
{
    //反填屠宰下的企业信息
    public class FanslaEnterpriseCommandHandler:IRequestHandler<FanslaEnterpriseCommand,Enterprise>
    {
        private readonly IslaughterService _slaService;

        public FanslaEnterpriseCommandHandler(IslaughterService slaService)
        {
            _slaService = slaService;
        }

        public async Task<Enterprise> Handle(FanslaEnterpriseCommand request, CancellationToken cancellationToken)
        {
            return await _slaService.FanslaEnterprise(request.goodsid);
        }
    }
}
